home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / comm / mail / YamNet.lha / FSCode.lha / Rexx / Spot / FSDecode.spot next >
Text File  |  1995-03-11  |  1KB  |  46 lines

  1. /* FSDecode.spot written by Vincenzo Scarpa    */
  2. /* Install as 'FSDecode...' in the ARexx menu. */
  3.  
  4. address spot
  5. options results
  6.  
  7. 'ismessages'
  8. if rc = 5 then do
  9.    'requestnotify "Use in message window only!"'
  10.    exit
  11.    end
  12.  
  13. call AddLib('rexxsupport.library',0,-30,0)
  14.  
  15. saveascii 't:spotfs.tmp' overwrite
  16.  
  17. if Open(in,'t:spotfs.tmp','r') then do
  18.    if checkfscoded(in)=1 then do
  19.       call close(in)
  20.  
  21.       'requestpath title "Pick a directory" path "RAM:"'
  22.       if rc = 0 then do
  23.          dirname = result
  24.          olddir = pragma('d', dirname)
  25.          ADDRESS COMMAND 'FScode >NIL: t:spotfs.tmp'
  26.          call pragma('d', olddir)
  27.          'requestnotify "File decoded..."'
  28.          end
  29.       end
  30.    else do
  31.       call close(In)
  32.       'requestnotify "This message does not contain FSEncoded Data"'
  33.       end
  34.    call Delete('t:spotfs.tmp')
  35.    end
  36.  
  37. exit /* done here */
  38.  
  39. checkfscoded: procedure
  40.    PARSE ARG In
  41.    do while ~eof(in)
  42.    if word(readln(in),1)='!start' then
  43.       return 1
  44.       end
  45.    return 0
  46.